home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / gs24src.zip / GSCHAR.H < prev    next >
C/C++ Source or Header  |  1992-03-25  |  4KB  |  81 lines

  1. /* Copyright (C) 1989, 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* gschar.h */
  21. /* Character operations for Ghostscript library */
  22.  
  23. /* String display, like image display, uses an enumeration structure */
  24. /* to keep track of what's going on (aka 'poor man's callback'). */
  25. typedef struct gs_show_enum_s gs_show_enum;
  26. extern const uint gs_show_enum_sizeof;
  27.  
  28. /* The routines all come in two versions, */
  29. /* one that uses the C convention of null-terminated strings, */
  30. /* and one that supplies a length. */
  31. int    gs_show_init(P3(gs_show_enum *, gs_state *, char *)),
  32.     gs_show_n_init(P4(gs_show_enum *, gs_state *, char *, uint)),
  33.     gs_ashow_init(P5(gs_show_enum *, gs_state *, floatp, floatp, char *)),
  34.     gs_ashow_n_init(P6(gs_show_enum *, gs_state *, floatp, floatp, char *, uint)),
  35.     gs_widthshow_init(P6(gs_show_enum *, gs_state *, floatp, floatp, char, char *)),
  36.     gs_widthshow_n_init(P7(gs_show_enum *, gs_state *, floatp, floatp, char, char *, uint)),
  37.     gs_awidthshow_init(P8(gs_show_enum *, gs_state *, floatp, floatp, char, floatp, floatp, char *)),
  38.     gs_awidthshow_n_init(P9(gs_show_enum *, gs_state *, floatp, floatp, char, floatp, floatp, char *, uint)),
  39.     gs_kshow_init(P3(gs_show_enum *, gs_state *, char *)),
  40.     gs_kshow_n_init(P4(gs_show_enum *, gs_state *, char *, uint)),
  41.     gs_stringwidth_init(P3(gs_show_enum *, gs_state *, char *)),
  42.     gs_stringwidth_n_init(P4(gs_show_enum *, gs_state *, char *, uint)),
  43.     gs_charpath_init(P4(gs_show_enum *, gs_state *, char *, int)),
  44.     gs_charpath_n_init(P5(gs_show_enum *, gs_state *, char *, uint, int));
  45.  
  46. /* After setting up the enumeration, all the string-related routines */
  47. /* work the same way.  The client calls gs_show_next until it returns */
  48. /* a zero (successful completion) or negative (error) value. */
  49. /* Other values indicate the following situations: */
  50.  
  51.     /* The client must render a character: obtain the code from */
  52.     /* gs_show_current_char, do whatever is necessary, and then */
  53.     /* call gs_show_next again. */
  54. #define gs_show_render 1
  55.  
  56.     /* The client has asked to intervene between characters (kshow). */
  57.     /* Obtain the previous and next codes from gs_kshow_previous_char */
  58.     /* and gs_kshow_next_char, do whatever is necessary, and then */
  59.     /* call gs_show_next again. */
  60. #define gs_show_kern 2
  61.  
  62. /* Because of composite fonts, character codes must be 32 bits. */
  63. typedef ulong char_code;
  64.  
  65. int    gs_show_next(P1(gs_show_enum *));
  66. char_code
  67.     gs_show_current_char(P1(gs_show_enum *)),
  68.     gs_kshow_previous_char(P1(gs_show_enum *)),
  69.     gs_kshow_next_char(P1(gs_show_enum *));
  70. void    gs_show_width(P2(gs_show_enum *, gs_point *));    /* cumulative width */
  71. int    gs_show_in_charpath(P1(gs_show_enum *));    /* return charpath flag */
  72.  
  73. /* Convert an image to an outline encoding. */
  74. int    gs_type1imagepath(P10(gs_state *, const byte *, int, int,
  75.                   floatp, floatp, floatp, floatp, byte *, uint));
  76.  
  77. /* Font cache and metrics operators */
  78. int    gs_setcachedevice(P8(gs_show_enum *, gs_state *, floatp, floatp, floatp, floatp, floatp, floatp));
  79. int    gs_setcharwidth(P4(gs_show_enum *, gs_state *, floatp, floatp));
  80. int    gs_setmetrics(P4(gs_show_enum *, gs_state *, gs_point *, gs_point *));
  81.